package ijij41.togetherTrain.recruit;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;

import ijij41.togetherTrain.common.AbstractTrainListActivity;
import ijij41.togetherTrain.participate.RoomListActivity;
import ijij41.togetherTrain.resource.TrainListRow;


public class TrainListRecruitActivity extends AbstractTrainListActivity{

	protected void publicOnItemClick(AdapterView<?> arg0, View arg1,
			int position, long arg3) {
	
		
		 TrainListRow trainListRow = (TrainListRow) arg0.getAdapter().getItem(
		 position);
		
	
			
			Intent roomCreateIntent = new Intent(TrainListRecruitActivity.this,
					RoomCreateActivity.class);
			
			/*trainListActivity.putExtra("time","10:00");
			trainListActivity.putExtra("startStation","서울");
			trainListActivity.putExtra("endStation","부산");
			trainListActivity.putExtra("numPerson","1");*/
			
			// get parameters from before activity
			Intent intent = getIntent();
			
			String date = intent.getStringExtra("date");
			String numRecruitMember = intent.getStringExtra("numRecruitMember");
			
			
			//roomCreateIntent.putExtra("function",FROM_RESERVATION);
			
			roomCreateIntent.putExtra("date",date);
			roomCreateIntent.putExtra("trainNum",trainListRow.getTrainNum());
			roomCreateIntent.putExtra("startTime",trainListRow.getStartTime());
			roomCreateIntent.putExtra("startStation",trainListRow.getStartStation());
			roomCreateIntent.putExtra("endtTime",trainListRow.getEndTime());
			roomCreateIntent.putExtra("endStation",trainListRow.getEndStation());
			roomCreateIntent.putExtra("numRecruitMember",numRecruitMember);
										
			
			startActivity(roomCreateIntent);
			
			
	}
}

